<p>
 Main page for challenges
</p>

<p>
	<?php 
		if ($num_of_pending_invitation > 0)
		{
			echo 'You have ' . $num_of_pending_invitation . ' challenge invitation(s). Please click ';
			echo anchor('c_challenge/confirm_invitation', 'Confirm Invitation');
			echo ' to either accept or deny them.'; 	
		}
	?>
</p>

<p>
<?php echo anchor('c_challenge/create_challenge', 'Create Challenge'); ?>
</p>


<p>
<?php echo 'List of challenges that you are the owner to'; ?>
</p>

<?php
        echo form_open('c_challenge') . PHP_EOL;
		echo validation_errors();
		echo $delete_owner_challenge_error . PHP_EOL;
        echo $owner_challenge_table . PHP_EOL;
?>

<p>
<?php
	if ($owner_challenges_exists) {
		$config = array(	'name'		=> 'delete_chalenges',
							'value'		=> 'Delete challenges',
							'onclick'	=> 'return confirm(\'Are you sure want to delete those challenge?\')'
							);
		
		echo form_submit($config);
	}
?>
</p>

<p>
<?php echo 'List of challenges that you are their participants'; ?>
</p>

<?php
        echo $participant_challenge_table . PHP_EOL;
?>

</form>